<% content_for :sidebar do %>
  <h2><%= @course.name %></h2>
  <%= sidebar_button_link 'Edit', edit_course_path(@course) %>
  <%#= sidebar_button_link 'Destroy', @course, method: :delete %>
  <%= sidebar_button_link 'Course Listings', courses_path %>
<% end %>

<p>
  <b>Status:</b> <%= success_or_warning_label(@course.status, 'Active') %>
</p>

<p><b>Description:</b> <%= @course.description %></p>

<p><b>Duration:</b> <%= pluralize(@course.duration, 'hour') %></p>

<p><b>Term:</b> <%= pluralize(@course.term, 'month') %></p>

<p><b>Comments:</b> <%= @course.comments %></p>

<p><b>Category:</b> <%= @course.category %></p><br/>

<table class="table table-striped table-bordered">
  <thead>
    <tr><th>Skills This Course Advances</th></tr>
  </thead>
  <tbody>
    <%= render @course.skills.uniq %>
  </tbody>
</table>

<div class="accordion">
  <h3>People Who Took This Course (<%= @course.people.active.uniq.count %>)</h3>
  <div>
    <table class="table table-striped table-bordered">
      <tbody>
        <%= render @course.people.active.uniq %>
      </tbody>
    </table>
  </div>

  <h3>Active Police Members Needing This Course ( <%= (Person.police.active - @course.people.active.uniq).count %> )</h3>
  <div>
    <table class="table table-striped table-bordered">
      <tbody>
        <%= render Person.police.active - @course.people.active.uniq %>
      </tbody>
    </table>
  </div>

  <h3>Active CERT Members Needing This Course ( <%= (Person.cert.active - @course.people.active.uniq).count %> )</h3>
  <div>
    <table class="table table-striped table-bordered">
      <tbody>
        <%= render Person.cert.active - @course.people.active.uniq %>
      </tbody>
    </table>
  </div>
</div>
